<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>${fns:getConfig('productName')}</title>
  <link rel="stylesheet" href="${ctxStatic}/layui-v2.5.6/layui/css/layui.css">
  <script type="text/javascript" src="${ctxStatic}/layui-v2.5.6/layui/layui.js"></script>



</head>


<body>

<div class="layui-fluid">
<div class="layui-card">
<!-- <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="padding-top: 10px;padding-bottom: 10px;">
   	
  <div class="layui-form-item">
  <label class="layui-form-label">融资银行：</label>
	<div class="layui-input-inline" style="width: 160px;">
	     <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
	</div>
	<label class="layui-form-label">性别:</label>
	<div class="layui-input-inline" style="width: 160px;">
	     <input type="text" id="sex" name="sex" autocomplete="off" class="layui-input">
	</div>
	

    
     <button class="layui-btn layuiadmin-btn-comm" id="queryBtn" data-type="reload" lay-submit="" lay-filter="LAY-app-contcomm-search">
         <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
    </button>
  </div>
  
</div> -->
<div class="layui-card-body">
	<table id="table" lay-filter="test" class="demo-tree-more"></table>
</div>
</div>
</div>


<script type="text/html" id="toolbarDemo">
  <div class="layui-btn-container">
	
    	<button class="layui-btn layui-btn-sm" lay-event="add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
	
  </div>
</script>


<!-- 行工具栏 -->
<script type="text/html" id="barDemo">
      <a class="layui-btn layui-btn-xs layui-btn-normal btn-auth" lay-event="edit" ekper="web/disease/editDisease">编辑</a>
	  <a class="layui-btn layui-btn-xs layui-btn-normal btn-auth" lay-event="edit" ekper="web/disease/editDisease">查看</a>
      <a class="layui-btn layui-btn-xs layui-btn-danger btn-auth" lay-event="del" ekper="web/disease/deleteDisease">删除</a>


</script>


<script>
layui.use(['table','form','laydate'], function(){
  var table = layui.table;
  var form = layui.form; 
  var $ = layui.$;
  var laydate = layui.laydate;
  
  var firstDate = new Date();

  table.render({
	id: 'thisReloadId'
    ,elem: '#table'
    ,height: 650
    ,url:'${ctx}/jx/financingBankInformation/listByAjax'
     ,toolbar: '#toolbarDemo'  //开启头部工具栏，并为其绑定左侧模板
    ,defaultToolbar: ['filter', 'exports', 'print']
     ,title: '人员管理' 
    ,totalRow:true//开启合计行
    ,cols: [[	 
               // {type:'id',title:'序号'}         
             	 {field:'financingBank', title:'融资银行',width:400}
             	  ,{field:'createBy', title:'创建者', width:400} 
                  ,{field:'createDate', title:'创建时间',width:400}
                  ,{field:'updateBy', title:'更新者',width:400} 
                  ,{field:'updateDate', title:'更新时间',width:400}
                  ,{field:'remarks', title:'备注',width:200} 
                  ,{fixed: 'right', title:'操作', toolbar: '#barDemo',width:350}
                   
    ]]
    ,page: false
    ,done: function (res, curr, count) {
    	$(".layui-table th").css({"font-family":"黑体","font-size":"15","font-weight":"bold"});// 设定表格标题字体加粗
    }
  });
	
  /* $('#queryBtn').on('click', function(){
	  var name = $('#name').val();
     var vehicleNo = $('#vehicleNo').val();    
  		 /* alert("rent value:"+rent);    
      //执行重载
      table.reload('thisReloadId', {
    	method : 'post',
        where: { //查询条件
        	name: name,
        	/* sex: sex   
        }
      });
        /*  alert("你好嘛! value:"+rent);  
  });  */

  
  
  
  //头工具栏事件
  table.on('toolbar(test)', function(obj){
    var checkStatus = table.checkStatus(obj.config.id);
    data = checkStatus.data; //获取选中的数据
    switch(obj.event){
      case 'add':
        layer.open({
        	id:'1',
    		type: 2,
    	    title: '增加资产',
    	    btn: ['关闭'],
    	    yes: function(index, layero){
    	    	layer.close(index);
    	    },
    	    shadeClose: true,
    	    shade: false,
    	    area: ['893px', '650px'],
    	    content: '${ctx}/jx/financingBankInformation/form'
    	});
        
      break;
    };
  });
  //监听行工具事件
    table.on('tool(test)', function(obj){
    var data = obj.data;
    if(obj.event === 'del'){
      layer.confirm('真的删除该行么？', function(index){
        $.ajax({
            url: "${ctx}/jx/financingBankInformation/deleteById",
            type: "POST",
            dataType: "json",
            data: {
            	id : data.id
            },
            async: false,
            success: function(data){
                layer.close(index);
                //执行重载
                table.reload('thisReloadId', {
                  page: {
                    curr: 1 //重新从第 1 页开始
                  }
                }, 'data');
                layer.msg(data);
            },
            error: function(){
            	layer.msg('删除失败', {icon: 2});
            }
        });
      });
    }   else if(obj.event === 'edit'){
    	//iframe窗
    	layer.open({
    		id:'3',
    		type: 2,
    	    title: '编辑伙食支出',
    	    btn: ['关闭'],
    	    yes: function(index, layero){
    	    	layer.close(index);
    	    },
    	    shadeClose: true,
    	    shade: false,
    	    area: ['893px', '650px'],
    	    content: '${ctx}/jx/financingBankInformation/form?id='+data.id
    	});	
    } 
    
  }); 
  
  function timestampToTime(timestamp) {
	    var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
	    var Y = date.getFullYear() + '-';
	    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
	    var D = date.getDate();
	    return Y + M + D;
  }
});
</script>
</body>
</html>